<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <div :style='boxStyles'></div>
        <button @click='change'> 修改</button>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                boxStyle: {
                    'background-color': 'hotpink',
                   
                
                },
                boxStyles: [{
                   
                    height: '300px',
                   
                }
]
            },
            methods: {
                change() {
                  
                  this.boxStyles.push(this.boxStyle)
                }

            }
        })
    </script>
</body>

</html>